package cn.javadog.smartbreeding.core.config;

import cn.javadog.smartbreeding.core.config.exception.UserAuthException;
import cn.javadog.smartbreeding.core.config.util.Ret;
import cn.javadog.smartbreeding.core.constants.ErrMsg;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常处理
 * @author 余勇
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

	@ExceptionHandler(UserAuthException.class)
	public Ret handleUserAuthException(){
		return Ret.fail(ErrMsg.USER_AUTH_EXCEPTION_ERR_MSG);
	}

}
